﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DuelQuizz.contract;
using DuelQuizz.DuelQuizzServiceReference;
using DuelQuizzServer;

namespace DuelQuizz
{
    /// <summary>
    /// Interaction logic for AccountCreationUserControl.xaml
    /// </summary>
    public partial class AccountCreationUserControl : UserControl
    {
        public AccountCreationUserControl()
        {
            InitializeComponent();
        }

        private void Button_Click_Validate(object sender, RoutedEventArgs e)
        {
            //MessageBox.Show("youpi !");
            string login = textbox_login.Text;
            string password = textbox_password.Password;
            string confirm =  textbox_password_confirm.Password;

            if (password.Equals(confirm))
            {
                AppServices.getDuelQuizzServices().createUser(login, password, "user", "france");
                MainWindow.changeWindows(new LoginUserControl());
            }
            else
            {
                MessageBox.Show("Le mot de passe ne correspond pas");
            }

            


        }
    }
}
